package com.yidu.BusinessData.mapper;

import com.yidu.BusinessData.entity.Broker;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 券商设置操作类
 * @author zhouhongyu
 * @since 2022/8/10
 * @version 1.0
 */

@Repository
@Mapper
public interface BrokerMapper {
    //查询条数
    @Select("select count(*) from broker")
    public int selectCount();
    //分页加条件查询
    @Select("select * from broker where brokerName like #{brokerName} limit #{page},#{limit}")
    public List<Broker> selectBroker(Map map);
    //增加数据
    @Insert("insert into broker values(#{brokerId},#{brokerName},#{brokerDesc},#{brokerIntroduce})")
    public int insertBroker(Broker broker);
    //删除数据
    @Delete("delete from broker where brokerId=#{brokerId}")
    public int deleteBroker(String brokerId);
    //修改数据
    @Update("update broker set brokerName=#{brokerName},brokerDesc=#{brokerDesc},brokerIntroduce=#{brokerIntroduce} where brokerId=#{brokerId}")
    public int updateBroker(Broker broker);
}
